using System;
namespace ch.ethz.ssh2
{
	
	/// <summary> An <code>InteractiveCallback</code> is used to respond to challenges sent
	/// by the server if authentication mode "keyboard-interactive" is selected.
	/// 
	/// </summary>
	/// <seealso cref="Connection.authenticateWithKeyboardInteractive(String,">
	/// String[], InteractiveCallback)
	/// 
	/// </seealso>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	
	public interface InteractiveCallback
	{
		/// <summary> This callback interface is used during a "keyboard-interactive"
		/// authentication. Every time the server sends a set of challenges (however,
		/// most often just one challenge at a time), this callback function will be
		/// called to give your application a chance to talk to the user and to
		/// determine the response(s).
		/// <p>
		/// Some copy-paste information from the standard: a command line interface
		/// (CLI) client SHOULD print the name and instruction (if non-empty), adding
		/// newlines. Then for each prompt in turn, the client SHOULD display the
		/// prompt and read the user input. The name and instruction fields MAY be
		/// empty strings, the client MUST be prepared to handle this correctly. The
		/// prompt field(s) MUST NOT be empty strings.
		/// <p>
		/// Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details.
		/// <p>
		/// Note: clients SHOULD use control character filtering as discussed in
		/// RFC4251 to avoid attacks by including
		/// terminal control characters in the fields to be displayed.
		/// 
		/// </summary>
		/// <param name="name">the name String sent by the server.
		/// </param>
		/// <param name="instruction">the instruction String sent by the server.
		/// </param>
		/// <param name="numPrompts">number of prompts - may be zero (in this case, you should just
		/// return a String array of length zero).
		/// </param>
		/// <param name="prompt">an array (length <code>numPrompts</code>) of Strings
		/// </param>
		/// <param name="echo">an array (length <code>numPrompts</code>) of booleans. For
		/// each prompt, the corresponding echo field indicates whether or
		/// not the user input should be echoed as characters are typed.
		/// </param>
		/// <returns> an array of reponses - the array size must match the parameter
		/// <code>numPrompts</code>.
		/// </returns>
		System.String[] replyToChallenge(System.String name, System.String instruction, int numPrompts, System.String[] prompt, bool[] echo);
	}
}